// @ts-ignore
/* eslint-disable */
import request from '@/request'

/** 添加用户 管理员添加用户 POST /manager/add */
export async function addUser(body: API.UserAddDTO, options?: { [key: string]: any }) {
  return request<API.BaseResponseLong>('/manager/add', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 删除应用 管理员根据 id 删除任意应用 POST /manager/app/delete */
export async function deleteApp(body: API.DeleteRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/manager/app/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 设置精选应用 管理员设置或取消应用精选状态 POST /manager/app/feature */
export async function setAppFeature(body: API.AppFeatureDTO, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/manager/app/feature', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 获取应用 管理员根据 id 查看应用详情 GET /manager/app/getById */
export async function getAppById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getAppByIdParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseAppVO>('/manager/app/getById', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 分页获取应用 管理员分页查询应用列表 POST /manager/app/list */
export async function listAppByPage(body: API.AppQueryAdminDTO, options?: { [key: string]: any }) {
  return request<API.BaseResponsePageAppVO>('/manager/app/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 分页获取精选应用 管理员分页查询所有精选应用列表 POST /manager/app/list/featured */
export async function listFeaturedAppByPage(
  body: API.AppQueryDTO,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponsePageAppVO>('/manager/app/list/featured', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 更新应用 管理员根据 id 更新任意应用 POST /manager/app/update */
export async function updateApp(body: API.AppUpdateAdminDTO, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/manager/app/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 删除用户 管理员删除用户 POST /manager/delete */
export async function deleteUser(body: API.DeleteRequest, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/manager/delete', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 获取用户 管理员根据ID获取用户详情 GET /manager/getById */
export async function getUserById(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.getUserByIdParams,
  options?: { [key: string]: any }
) {
  return request<API.BaseResponseUserAdminVO>('/manager/getById', {
    method: 'GET',
    params: {
      ...params,
    },
    ...(options || {}),
  })
}

/** 检查管理员 检查当前用户是否为管理员 GET /manager/is-admin */
export async function isAdmin(options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/manager/is-admin', {
    method: 'GET',
    ...(options || {}),
  })
}

/** 分页获取用户 管理员分页获取用户列表 POST /manager/list */
export async function listUserByPage(body: API.UserQueryDTO, options?: { [key: string]: any }) {
  return request<API.BaseResponsePageUserAdminVO>('/manager/list', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}

/** 更新用户 管理员更新用户信息 POST /manager/update */
export async function updateUser(body: API.UserUpdateAdminDTO, options?: { [key: string]: any }) {
  return request<API.BaseResponseBoolean>('/manager/update', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  })
}
